<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center particular_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub particular_fd0_0'>
          <view class='flex flex-wrap align-center particular_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  particular_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='particular_fd0_0_c1_c0'>详情</text>
          </view>
          <view class='flex flex-wrap align-center justify-end particular_fd0_0_c0'>
          </view>
        </view>
      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout particular_flex_1"
       >
        <!--     <view class='flex flex-direction align-stretch particular_fd1_0'>
          <view class='flex flex-wrap align-center justify-between particular_fd1_0_c0'>
            <view class='flex flex-wrap align-center'>
              <text>{{list.create_time}}</text>
            </view>
            <view class='flex flex-wrap align-center'>
              <text class='fu-iconfont2  particular_fd1_0_c0_c1_c0'>&#xe8c7;</text>
              <text class='particular_fd1_0_c0_c1_c1'>{{list.browse}}</text>
            </view>
          </view>
          <view class='flex flex-wrap align-center particular_fd1_0_c1'>
            <view class='flex flex-wrap align-center particular_fd1_0_c1_c0'>
              <text>来源：</text>
              <text class='particular_fd1_0_c0_c1_c1'>{{list.source}}</text>
              <view class='flex flex-wrap align-center particular_fd1_0_c1_c0_c2'>
              </view>
            </view>
            <view class='flex flex-wrap align-center particular_fd1_0_c1_c0'>
              <text class='particular_fd1_0_c0_c1_c1'>作者：</text>
              <text class='particular_fd1_0_c0_c1_c1'>{{list.author}}</text>
              <view class='flex flex-wrap align-center particular_fd1_0_c1_c0_c2'>
              </view>
            </view>
            <view class='flex flex-wrap align-center particular_fd1_0_c1_c0'>
              <text class='particular_fd1_0_c0_c1_c1'>编辑：</text>
              <text class='particular_fd1_0_c0_c1_c1'>{{list.editor_in_chief}}</text>
            </view>
          </view>
        </view> -->
        <view class='flex flex-wrap align-center particular_fd1_1'>
          <view class='flex flex-wrap align-center justify-center flex-sub particular_fd1_1_c0'>
            <text class='particular_fd1_1_c0_c0'>{{list.title}}</text>
          </view>
          <view style="display: flex;justify-content:flex-start;width: 100%;margin-bottom: 40rpx;">
            <view class='flex flex-wrap align-center' style="margin-right: 30rpx;">
              <text style="color: #b5b5b5;">{{list.create_time}}</text>
            </view>
            <view class='flex flex-wrap align-center' v-if="list.browse">
              <text class='fu-iconfont2  particular_fd1_0_c0_c1_c0' style="color: #b5b5b5;font-size: 24rpx;">浏览量：</text>
              <text class='particular_fd1_0_c0_c1_c1' style="color: #b5b5b5;">{{list.browse}}</text>
            </view>
          </view>

          <jyf-parser class='particular_fd1_1_c1' v-if="list.content" :html="list.content | richTextFormat">
          </jyf-parser>

          <jyf-parser class='particular_fd1_1_c1' v-if="list.body" :html="list.body | richTextFormat">
          </jyf-parser>

          <view class='particular_fd1_0_c1' style="color: #b5b5b5;" v-if="list.source||list.author||list.editor_in_chief">
            <view class='flex flex-wrap align-center particular_fd1_0_c1_c0' style="margin-left: 4rpx;" v-if="list.source">
              <!-- <view class='flex flex-wrap align-center particular_fd1_0_c1_c0_c2'>
              </view> -->
              <text>来源：</text>
              <text class='particular_fd1_0_c0_c1_c1'>{{list.source}}</text>

            </view>
            <view class='flex flex-wrap align-center particular_fd1_0_c1_c0' v-if="list.author">
    <!--          <view class='flex flex-wrap align-center particular_fd1_0_c1_c0_c2'>
              </view> -->
              <text class='particular_fd1_0_c0_c1_c1'>作者：</text>
              <text class='particular_fd1_0_c0_c1_c1'>{{list.author}}</text>

            </view>
            <view class='flex flex-wrap align-center particular_fd1_0_c1_c0' v-if="list.editor_in_chief">
        <!--      <view class='flex flex-wrap align-center particular_fd1_0_c1_c0_c2'>
              </view> -->
              <text class='particular_fd1_0_c0_c1_c1'>编辑：</text>
              <text class='particular_fd1_0_c0_c1_c1'>{{list.editor_in_chief}}</text>
            </view>
          </view>



        </view>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </page-body>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},


    data() {
      return {
        "list": {
          "aid": "",
          "title": "",
          "content": "",
          "browse": "",
          "create_time": "",
          "source": "",
          "author": "",
          "editor_in_chief": ""
        },
        "aid": "",
        type: "",
        user_id: uni.getStorageSync("userInfos").id
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {
      let {
        aid,
        type
      } = options
      if (aid !== undefined) this.aid = aid
      if (type !== undefined) this.type = type
      console.log("type=>", this.type)
      // this.set66bdb4020cdec(this.aid)
      this.getListFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      /* 添加浏览记录*/
      async set66bdb4020cdec(soldierarticle_id) {
        let data66bdb4020cdec = await this.$api.post(global.apiUrls.post66bdb4020cdec, {
          soldierarticle_id
        })

        if (data66bdb4020cdec.data.code != 1) {
          this.$message.info(data66bdb4020cdec.data.msg);
          return
        }
        let infolist = data66bdb4020cdec.data;
        this.getListFunc()
      },

      //获取数据
      async getListFunc() {
        //请求方法
        //数据验证
        let datalist
        if (this.type == 1) {
          datalist = await this.$api.get(global.apiUrls.post638181d05a486, {
            aid: this.aid,
            user_id: this.user_id
          });
        } else if(this.type == 10){
          datalist = await this.$api.get(global.apiUrls.post66bef02f73dec, {
            aid: this.aid,
            // user_id: this.user_id
          });
        } else {
          datalist = await this.$api.get(global.apiUrls.post66bdabc7c02d1, {
            aid: this.aid
          });
        }
        if (datalist.data.code != 1) {
          this.$message.info(datalist.data.msg);
          return
        }
        let infolist = datalist.data;
        this.list = infolist.data

      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #f6f6f6;
    background-size: 100% auto;
  }

  .particular_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .particular_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .particular_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .particular_fd0_0_c0 {
    width: 120rpx;
  }

  .particular_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .particular_flex_1 {
    // padding: 0 24rpx;
  }

  ::v-deep .particular_fd1_1_c1 {
    width: 100%;
  }

  .particular_fd1_1_c0_c0 {
    color: rgba(51, 51, 51, 1);
    font-size: 50rpx;
    font-weight: 700;
    line-height: 60rpx;
    text-align: center;
  }

  .particular_fd1_1_c0 {
    margin: 0rpx 0rpx 32rpx 0rpx;
  }

  .particular_fd1_1 {
    background: #Fff;
    // border-radius: 16rpx;
    padding: 32rpx 28rpx 32rpx 28rpx;
    background-size: 100% auto;
  }

  .particular_fd1_0_c1_c0_c2 {
    background: rgba(153, 153, 153, 1);
    width: 1rpx;
    height: 33rpx;
    background-size: 100% auto;
    margin: 0rpx 0rpx 0rpx 16rpx;
  }

  .particular_fd1_0_c1_c0 {
    font-size: 24rpx;
    line-height: 33rpx;
    font-weight: 400;
    margin-bottom: 20rpx;

  }

  .particular_fd1_0_c1 {
    color: rgba(153, 153, 153, 1);
     margin-top: 40rpx;
  }

  .particular_fd1_0_c0_c1_c1 {
    margin: 0rpx 0rpx 0rpx 5rpx;
  }

  .particular_fd1_0_c0_c1_c0 {
    color: rgba(204, 34, 28, 1);
  }

  .particular_fd1_0_c0 {
    margin: 0rpx 0rpx 16rpx 0rpx;
    color: rgba(51, 51, 51, 1);
    font-size: 28rpx;
    font-weight: 600;
    line-height: 40rpx;
  }

  .particular_fd1_0 {
    background: #Fff;
    margin: 0rpx 0rpx 24rpx 0rpx;
    border-radius: 16rpx;
    height: 152rpx;
    background-size: 100% auto;
    padding: 31rpx 32rpx 31rpx 32rpx;
  }
</style>
